﻿Namespace ViewModel

    Public Class LiveProgramTitleSubsetViewModel
        Inherits ViewModelBase
        Implements IComparable

        Private Model As Model.LiveProgram

        Public Sub New(ByVal model As Model.LiveProgram)
            Me.Model = model
        End Sub

        Public ReadOnly Property Title() As String
            Get
                Return Model.Title
            End Get
        End Property

        Public ReadOnly Property IsMemberOnly() As Boolean
            Get
                Return Model.IsMemberOnly
            End Get
        End Property

        Public ReadOnly Property IsFace() As Boolean
            Get
                Return Model.IsFace
            End Get
        End Property

        Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo

            Dim other As LiveProgramTitleSubsetViewModel = Nothing
            If TryCast(other, LiveProgramTitleSubsetViewModel) Is Nothing Then
                Return 0
            End If

            If other.Title > Me.Title Then
                Return -1
            ElseIf other.Title < Me.Title Then
                Return 1
            Else
                Return 0
            End If
        End Function

        'Public Shadows Function Equals(ByVal obj As Object) As Boolean
        '    Return Me.CompareTo(obj) = 0
        'End Function
        'Public Shared Operator =(ByVal r1 As LiveProgramTitleSubsetViewModel, ByVal r2 As LiveProgramTitleSubsetViewModel) As Boolean
        '    Return r1.Equals(r2)
        'End Operator
        'Public Shared Operator <>(ByVal r1 As LiveProgramTitleSubsetViewModel, ByVal r2 As LiveProgramTitleSubsetViewModel) As Boolean
        '    Return Not (r1 = r2)
        'End Operator
        'Public Shared Operator <(ByVal r1 As LiveProgramTitleSubsetViewModel, ByVal r2 As LiveProgramTitleSubsetViewModel) As Boolean
        '    Return (r1.CompareTo(r2) < 0)
        'End Operator
        'Public Shared Operator >(ByVal r1 As LiveProgramTitleSubsetViewModel, ByVal r2 As LiveProgramTitleSubsetViewModel) As Boolean
        '    Return (r1.CompareTo(r2) > 0)
        'End Operator

    End Class
End Namespace
